@datapos/datapos-development 0.3.116 → 0.3.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datapos-development.es.js +14 -21
- package/package.json +1 -1
|
@@ -110,38 +110,31 @@ async function D() {
|
|
|
110
110
|
console.error("Error updating README:", i), process.exit(1);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
async function
|
|
113
|
+
async function M() {
|
|
114
114
|
const o = "<!-- OWASP_BADGE_START -->", e = "<!-- OWASP_BADGE_END -->";
|
|
115
115
|
try {
|
|
116
|
-
const i = JSON.parse(await t.readFile("./dependency-check-reports/dependency-check-report.json", "utf-8")), n = {
|
|
117
|
-
critical: 0,
|
|
118
|
-
high: 0,
|
|
119
|
-
moderate: 0,
|
|
120
|
-
low: 0,
|
|
121
|
-
info: 0,
|
|
122
|
-
unknown: 0
|
|
123
|
-
};
|
|
116
|
+
const i = JSON.parse(await t.readFile("./dependency-check-reports/dependency-check-report.json", "utf-8")), n = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
124
117
|
for (const u of i.dependencies)
|
|
125
118
|
if (u.vulnerabilities != null)
|
|
126
|
-
for (const
|
|
127
|
-
const
|
|
128
|
-
|
|
119
|
+
for (const g of u.vulnerabilities) {
|
|
120
|
+
const m = g.severity?.toLowerCase() ?? "unknown";
|
|
121
|
+
m in n ? n[m]++ : n.unknown++;
|
|
129
122
|
}
|
|
130
123
|
const s = {
|
|
131
124
|
critical: { color: "red", label: "Critical" },
|
|
132
125
|
high: { color: "orange", label: "High" },
|
|
133
126
|
moderate: { color: "yellow", label: "Moderate" },
|
|
134
127
|
low: { color: "green", label: "Low" },
|
|
135
|
-
info: { color: "brightgreen", label: "Info" },
|
|
136
128
|
unknown: { color: "lightgrey", label: "Unknown" }
|
|
137
129
|
}, r = [];
|
|
138
|
-
for (const [u,
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
for (const [u, g] of Object.entries(n)) {
|
|
131
|
+
if (g === 0) continue;
|
|
132
|
+
const m = s[u], y = `https://img.shields.io/badge/OWASP%20${m.label}-${g}-${m.color}`;
|
|
133
|
+
r.push(`[](./dependency-check-reports/dependency-check-report.html)`);
|
|
141
134
|
}
|
|
142
|
-
const d = Object.values(n).reduce((u,
|
|
135
|
+
const d = Object.values(n).reduce((u, g) => u + g, 0);
|
|
143
136
|
console.info(`✅ Total vulnerabilities found: ${d}`), console.info(
|
|
144
|
-
` Critical: ${n.critical}, High: ${n.high},
|
|
137
|
+
` Critical: ${n.critical}, High: ${n.high}, Moderate: ${n.moderate}, Low: ${n.low}, Unknown: ${n.unknown}`
|
|
145
138
|
);
|
|
146
139
|
const a = await t.readFile("./README.md", "utf8"), c = a.indexOf(o), l = a.indexOf(e);
|
|
147
140
|
(c === -1 || l === -1) && (console.error("❌ Markers not found in README.md."), process.exit(1));
|
|
@@ -153,7 +146,7 @@ async function I() {
|
|
|
153
146
|
console.error("❌ Error updating README with OWASP badges:", i), process.exit(1);
|
|
154
147
|
}
|
|
155
148
|
}
|
|
156
|
-
async function
|
|
149
|
+
async function I() {
|
|
157
150
|
try {
|
|
158
151
|
console.info("🚀 Sending deployment notice...");
|
|
159
152
|
const o = JSON.parse(await t.readFile("config.json", "utf8")), e = {
|
|
@@ -242,8 +235,8 @@ export {
|
|
|
242
235
|
A as bumpVersion,
|
|
243
236
|
F as echoScriptNotImplemented,
|
|
244
237
|
D as insertLicensesIntoReadme,
|
|
245
|
-
|
|
246
|
-
|
|
238
|
+
M as insertOWASPDependencyCheckBadgeIntoReadme,
|
|
239
|
+
I as sendDeploymentNotice,
|
|
247
240
|
P as syncWithGitHub,
|
|
248
241
|
T as uploadDirectoryToR2,
|
|
249
242
|
_ as uploadModuleConfigToDO,
|
package/package.json
CHANGED